package com.example.lifecycledemo;

import android.app.Application;

import com.example.lifecycledemo.observer.MyApplicationObserver;

import androidx.lifecycle.ProcessLifecycleOwner;

/**
 * Created by xiuzhizhu
 * Date: 2020/11/29
 */

public class MyApplication extends Application {

    MyApplicationObserver myApplicationObserver;
    @Override
    public void onCreate() {
        super.onCreate();

        myApplicationObserver = new MyApplicationObserver();

        ProcessLifecycleOwner.get().getLifecycle()
                .addObserver(myApplicationObserver);
    }
}
